3 NetMHC Neoantigen Prediction

3.1 How much editing is there in mutations that have a predicted neoantigen?

3.2 Visualize as a scatter plot

Select epitopes to plot. use ninemers because they have the best training data in NetMHC

Plot a scatter of putatively immunogenic (ninemer) neoantigens

3.3 Show which allele (from our patient) is the most common in the global population?

source table for the patient’s alleles taken from http://www.allelefrequencies.net/

3.4 summarise neoantigens as an “immunoprint”

prepare TMB df to show what fraction of the TMB comes from immunogenic neoantigens

Select which neoantigens to show.

top_genes <- vcf_master_epitope %>%
    filter(ic50 < 500) %>% # ic50 binding cutoff
    filter(AD_T > 5) %>% # at least 5 reads
    filter(length == 9) %>% # make sure you have 9mers
    group_by(sample) %>% 
    top_n(50, wt=-ic50) # get top 50 ic50's per sample

top_genes <- unique(c(levels(as.factor(top_genes$gene)),
                      'PTEN', 'TP53', 'QKI', 'MAPK2', 'MAPK1', 'MAPK4', 'VEPH1',
                      'TGFBI',"SLC9A4", 'EGFR', 'CASP5', "MAP7", "MAP3K1", "MAP3K7",
                      "PTPN5", "PTPN11", "BRAF", "PTPRH", "AKT1", "AKT2"))

top_genes <- top_genes[!(top_genes %in% 
                           c('TTC39A', 'FLNC', 'USP48', 'AFM', 'LRRC32', 'GSR', 'CHRD',
                             'QKI', 'PTEN', 'EGFR', 'TP53', 'DAGLA', 'CENPI', 'C12orf45',
                             'ATP11A', 'ARHGEF28'))]

tmp <- vcf_master_epitope %>% mutate(ID=paste(sample, gene, ic50, sep='_')) %>% dplyr::select(ID, allele, length, combo, is_edited)


ninemer_df <- vcf_master_epitope %>% 
    filter(gene %in% top_genes) %>%
    group_by(sample, gene) %>% summarise(min_ic50=min(ic50)) %>%
    mutate(ID=paste(sample, gene, min_ic50, sep='_')) %>% 
    left_join(tmp, by=c('ID')) %>%
    dplyr::select(-ID) %>%
    filter(min_ic50 < 500)

ninemer_df$sample <- fct_relevel(ninemer_df$sample, c('Primary', "Recurrent_A", 'Recurrent_B', 'Recurrent_C'))
ninemer_df$gene <- as.factor(ninemer_df$gene)

rm(tmp, top_genes)
# order gene factor by number of samples the gene shows up in
tmp <- data.frame(samples_per_gene=summary(as.factor(ninemer_df$gene)),
                  gene=names(summary(as.factor(ninemer_df$gene))))


ninemer_df <- left_join(ninemer_df, tmp, by=c('gene'))
ninemer_df$gene <- as.factor(ninemer_df$gene)

ninemer_df$gene <- fct_reorder(ninemer_df$gene, .x=ninemer_df$samples_per_gene)

rm(tmp)
ninemer_df$is_edited <- as.character(ninemer_df$is_edited)
ninemer_df$allele <- as.factor(ninemer_df$allele)

4 immune cell deconvolution with xCELL

Read in xCELL results.

Show all xcell results, with the exception of stromal and other non-immune cell-types.

Filter xCELL results to showcase a subset of celltypes.

7 RSession Info

## R version 3.6.1 (2019-07-05)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS Catalina 10.15.1
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] grid      stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] lattice_0.20-38    gridExtra_2.3      ggpubr_0.2.3      
##  [4] magrittr_1.5       RColorBrewer_1.1-2 ggrepel_0.8.1     
##  [7] forcats_0.4.0      stringr_1.4.0      dplyr_0.8.3       
## [10] purrr_0.3.3        readr_1.3.1        tidyr_1.0.0       
## [13] tibble_2.1.3       ggplot2_3.2.1      tidyverse_1.2.1   
## 
## loaded via a namespace (and not attached):
##  [1] tidyselect_0.2.5 xfun_0.10        haven_2.1.1      colorspace_1.4-1
##  [5] vctrs_0.2.0      generics_0.0.2   htmltools_0.4.0  yaml_2.2.0      
##  [9] rlang_0.4.1      pillar_1.4.2     glue_1.3.1       withr_2.1.2     
## [13] modelr_0.1.5     readxl_1.3.1     lifecycle_0.1.0  munsell_0.5.0   
## [17] ggsignif_0.6.0   gtable_0.3.0     cellranger_1.1.0 rvest_0.3.4     
## [21] evaluate_0.14    labeling_0.3     knitr_1.25       broom_0.5.2     
## [25] Rcpp_1.0.2       scales_1.0.0     backports_1.1.5  jsonlite_1.6    
## [29] hms_0.5.2        digest_0.6.22    stringi_1.4.3    cowplot_1.0.0   
## [33] cli_1.1.0        tools_3.6.1      lazyeval_0.2.2   crayon_1.3.4    
## [37] pkgconfig_2.0.3  zeallot_0.1.0    ellipsis_0.3.0   xml2_1.2.2      
## [41] lubridate_1.7.4  assertthat_0.2.1 rmarkdown_1.16   httr_1.4.1      
## [45] rstudioapi_0.10  R6_2.4.0         nlme_3.1-141     compiler_3.6.1